This file is loosely based on Chapter 0 of The Mathematica Book: "Mathematica: A System for Doing Mathematics by Computer", by Stephen Wolfram. This book was published by Addison-Wesley in 1988, and is available at most bookstores.
The first line here is what you type into Mathematica. The second line is the result Mathematica gives. If you are reading this Notebook on a color system, the input is blue and the output purple.
It is a fact of mathematics that there is no way to get an exact formula for the solutions of a quintic equation like this. You can nevertheless ask Mathematica to give you numerical results. You get the five complex number roots to the equation.
Mathematica generates all graphics in PostScript, so that you can resize pictures, and make use of the resolution available on different types of printers.
You can use sequences of graphics cells in a Notebook as frames in a "movie". To show a movie, you select its sequence of cells (by clicking the bracket that encloses all of them), then type Y. The movie appears in the first graphics cell you have selected, so be sure it is visible in the window before starting the animation. The movie is produced by showing in rapid succession the graphics cells in the selected sequence. A click anywhere will stop the animation.
This Notebook contains a sample of animation in Mathematica. Due to disk space limitations, this is a very simple two-dimensional example. Look in the "Animations" folder on your disk for other examples of animated graphics.
This animation shows how the curve of a Bessel function changes with the order of the Bessel function. (The movie looks best when run fairly slowly, with the frames shown cyclically.)
The Unformatted text for this cell was not generated.
Use options in the Actions Settings dialog box to control
when Unformatted text is generated.
;[o]
-Graphics3D-
:[inactive; font = text; ]
This shows the dodecahedron as a three-dimensional graphical object.
As another example, we can use the definitions from the polyhedra package to create an image of a stellated icosahedron, which is often used as an icon for the Mathematica system.
:[inactive; output; endGroup; endGroup; font = output; ]
The Unformatted text for this cell was not generated.
Use options in the Actions Settings dialog box to control
when Unformatted text is generated.
;[o]
-Graphics3D-
:[inactive; startGroup; Cclosed; font = subsubsection; ]
More on Programming
:[inactive; font = text; ]
There are several styles of programming in Mathematica. One of them is procedural programming, as you would find in a standard structured programming language such as C or Pascal.
Another is "rule-based programming". The idea is to give transformation rules which specify how Mathematica should transform expressions it receives as input.
You can give rules that mimic the formulas you might find in a mathematics textbook.
Here is an example of how you might teach Mathematica about a new form of logarithm function, called nlog.
Mathematica consists of two parts — the "kernel", which actually does computations, and the "front end", which deals with interaction with the user. The kernel of Mathematica is essentially the same on all computers that support Mathematica. The front end, on the other hand, works differently on different kinds of computer.
On the Macintosh, Mathematica has a sophisticated front end that takes advantage of the Macintosh's unique user interface capabilities. (You can actually use the Macintosh front end even if you are using a "remote kernel", say on a supercomputer connected through a network.)
:[inactive; startGroup; Cclosed; font = subsubsection; ]
Notebooks
:[inactive; font = text; ]
One of the most important aspects of the Macintosh front end is its ability to support Mathematica "Notebooks".
This file is an example of a Notebook. Notebooks consist of a mixture of text, graphics, and Mathematica input.
Notebooks can be used like "interactive textbooks" — you read the text in the Notebook, then use the Mathematica input in the Notebook to perform calculations.
This Notebook defines the functions PointPlot, PointPlot3D, PointParamPlot3D, SpaceCurve, and PointSpaceCurve. These functions let you make discrete point plots in two and three dimensions. The SpaceCurve and PointSpaceCurve functions let you make three-dimensional functions of one parameter (lines or points in 3D). (Note: This demonstration copy does not include the actual definitions of the functions, only examples of their use.)
:[inactive; startGroup; Cclosed; font = section; ]
Examples
:[inactive; font = text; ]
Each of the functions defined in this Notebook is a variation of either Plot, Plot3D, or ParametricPlot3D. The arguments are quite similar to these standard functions. Following are descriptions of each of the functions.
:[inactive; startGroup; Cclosed; font = subsection; ]
PointPlot
:[inactive; font = text; ]
PointPlot[ f, {x, min, max, (step)}] produces a plot of f(x) vs. x. Here is an example: